import request from '@/utils/request'

// 获取部门比赛
export function getRace(data) {
  return request({
    url: '/race/getRace',
    method: 'post',
	data
  })
}

// 获取个人已参加比赛
export function getUserRace(data) {
  return request({
    url: '/user/getUserRace',
    method: 'post',
	data
  })
}

// 添加普通比赛
export function insertRace(data) {
  return request({
    url: '/race/insertRace',
    method: 'post',
	data
  })
}

// 添加人数限制比赛
export function insertLimitRace(data) {
  return request({
    url: '/race/insertLimitRace',
    method: 'post',
	data
  })
}

// 审核通过比赛
export function reviewedRace(raceId) {
  return request({
    url: '/race/reviewedRace',
    method: 'get',
	params: {raceId}
  })
}

// 审核不通过比赛
export function reviewedNoRace(raceId) {
  return request({
    url: '/race/reviewedNoRace',
    method: 'get',
    params: {raceId}
  })
}

// 参加人数限制比赛
export function kill(raceId) {
  return request({
    url: '/race/kill',
    method: 'get',
    params: {raceId}
  })
}

// 参加普通比赛
export function joinRace(raceId) {
  return request({
    url: '/race/joinRace',
    method: 'get',
    params: {raceId}
  })
}

// 用户退出比赛
export function quitRaceById(raceId) {
  return request({
    url: '/race/quitRaceById',
    method: 'get',
    params: {raceId}
  })
}